﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FormatTest
{
    public class dec_ref_pic_marking : base_func
    {
        public dec_ref_pic_marking(string bytes)
        {
            base.bytes = bytes;
            //IDR图像
            if (DecodeH264.vnal_unit.nal_unit_type == 5)
            {
                var no_output_of_prior_pics_flag = Convert.ToInt32(read_bits(1));
                var dec_ref_pic_marking = Convert.ToInt32(read_bits(1));
            }
            else
            {
                var adaptive_ref_pic_marking_mode_flag = Convert.ToInt32(read_bits(1));
                var memory_management_control_operation = 0;
                if (adaptive_ref_pic_marking_mode_flag != 0)
                {
                    do
                    {
                        memory_management_control_operation = columbus_ue();
                        if (memory_management_control_operation == 1 ||
memory_management_control_operation == 3)
                        {
                            var difference_of_pic_nums_minus1 = columbus_ue();
                        }
                        if (memory_management_control_operation == 2)
                        {
                            var long_term_pic_num = columbus_ue();
                        }
                        if (memory_management_control_operation == 3 ||
memory_management_control_operation == 6)
                        {
                            var long_term_frame_idx = columbus_ue();
                        }
                        if (memory_management_control_operation == 4)
                        {
                            var max_long_term_frame_idx_plus1 = columbus_ue();
                        }
                    }
                    while (memory_management_control_operation != 0);
                }
            }
        }
    }
}
